import { defineConfig } from 'vitepress'

// https://vitepress.dev/reference/site-config
export default defineConfig({
  title: "VitePress",
  description: "VitePress 学习",
  base: '/vitepress/',
  lastUpdated: true,
  themeConfig: {
    // https://vitepress.dev/reference/default-theme-config
    // 右侧导航栏显示多级目录
    outline: 'deep',
    lastUpdatedText: '最后更新',
    // 导航栏
    nav: [
      { text: 'Guide[指南]', link: '/guide/what-is-vitepress' },
      { text: 'Reference[配置]', link: '/reference/site-config' },
    ],

    //侧边栏
    sidebar: {
      '/guide':[
        {
          text: '安装',
          collapsed: false,
          items: [
            { text: '什么是 VitePress ？', link: '/guide/what-is-vitepress' },
            { text: '开始', link: '/guide/getting-started' },
            { text: '路由', link: '/guide/routing' },
            { text: '部署', link: '/guide/deploy' },
          ]
        },
        {
          text: '写作',
          collapsed: false,
          items: [
            { text: 'MarkDown', link: '/guide/markdown' },
            { text: 'Asset Handling', link: '/guide/asset-handling' },
            { text: 'Frontmatter', link: '/guide/frontmatter' },
            { text: 'Using Vue in Markdown', link: '/guide/using-vue' },
            { text: 'Internationalization', link: '/guide/i18n' },
          ]
        },
      ],
      '/reference':[
        {
          text: '配置',
          items: [
            { text: 'Site Config', link: '/reference/site-config' },
            { text: 'Frontmatter Config', link: '/reference/frontmatter-config' },
            { 
              text: 'Default Theme', 
              items: [
                { text: 'Overview', link: '/reference/default-theme-config' },
                { text: 'Algolia Search', link: '/reference/default-theme-search' },
              ]
            },
          ]
        }
      ]
    },

    socialLinks: [
      { icon: 'github', link: 'https://github.com/vuejs/vitepress' }
    ],

    // 全站搜索
    algolia: {
      appId: 'ZLJ2S1PQNX',
      apiKey: '62903d3a481e5400265315490f01ddb9',
      indexName: 'VitePress'
    }
  }
})
